package com.zrx.govern.component.easyexcel.starter.entity;

import com.zrx.govern.component.easyexcel.starter.enums.ExcelEnum;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.util.List;

/**
 * @author zhangxiaowei
 * @desc zip多excel文件导出对象
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@Builder
public class MultiExcelFile {

    @NotEmpty(message = "model不能为空")
    private String model;
    /**
     * 导出excel的对象集合
     * eg:List<Student>
     */
    @NotNull(message = "导出excel的对象集合")
    @Size(min = 1)
    private List<? extends Object> data;
    /**
     * excel文件名称
     */
    @NotEmpty(message = "excel文件名称")
    String fileName;
    /**
     * excel所在sheet
     */
    private String sheetName = "sheet1";
    /**
     * 导出excel数据对象class
     * eg:Student.class
     */
    @NotNull(message = "导出excel数据对象class不能为空")
    private Class clazz;
    /**
     * excel文件类型,默认XLSX
     */
    private ExcelEnum excelEnum = ExcelEnum.XLSX;
}
